<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>用户修改</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}" />
    <script th:src="@{/js/jquery-3.6.0.min.js}"></script>
</head>

<body>

    <div class="panel panel-primary">
        <div class="panel-heading">
            <div th:replace="~{header}">
            </div>
        </div>
    </div>

    <div class="container">
        <br><br>
        <div style="width:500px; height:70px;">
            <h4 align="center">用户信息修改</h4>
        </div><br>
        <form name="myform" method="post" class="form-horizontal" th:action="@{/user/update}" th:object="${user}">
            <input type="hidden" class="form-control" th:field="*{uid}" />

            <div class="form-group has-success">
                <label class="col-sm-2 col-md-2 control-label">姓名</label>
                <div class="col-sm-4 col-md-4">
                    <input type="text" class="form-control" th:field="*{username}" placeholder="请输入姓名" />
                </div>
            </div>

            <div class="form-group has-success">
                <label class="col-sm-2 col-md-2 control-label">性别</label>
                <div class="col-sm-4 col-md-4 radio">
                    <label>
                        <input type="radio" th:field="*{ssex}" value="男" />男
                    </label>
                    <label>
                        <input type="radio" th:field="*{ssex}" value="女" />女
                    </label>
                </div>
            </div>

            <div class="form-group has-success">
                <label class="col-sm-2 col-md-2 control-label">地址</label>
                <div class="col-sm-4 col-md-4">
                    <input type="text" class="form-control" th:field="*{mailingaddress}" placeholder="请输入地址" />
                </div>
            </div>

            <div class="form-group has-success">
                <label class="col-sm-2 col-md-2 control-label">手机号</label>
                <div class="col-sm-4 col-md-4">
                    <input type="text" class="form-control" th:field="*{phone}" placeholder="请输入手机号" />
                </div>
            </div>

            <div class="form-group has-success">
                <label class="col-sm-2 col-md-2 control-label">密码</label>
                <div class="col-sm-4 col-md-4">
                    <input type="text" class="form-control" th:field="*{password}" placeholder="请输入密码" />
                </div>
            </div>

            <div class="form-group has-success">
                <label class="col-sm-2 col-md-2 control-label">爱好</label>
                <div class="col-sm-4 col-md-4 radio">
                    <span th:each="t: ${hobbycode}">
                        <label th:text="${t[0]}"></label>
                        <input type="checkbox" name="hobby" th:value="${t[0]}"  th:checked="${t[1]} == 'checked'"/>
                    </span>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <span style="display:inline-block;width:80px"></span>
                    <button type="submit" class="btn btn-success">修改</button>
                    <span style="display:inline-block;width:40px"></span>
                    <button type="button" class="btn btn-primary" onclick="window.history.back()">返回</button>
                </div>
            </div>
        </form>
    </div>



</body>

</html>